<?php
namespace App\Http\Controllers\Client\Shop\Explore;

use App\Http\Controllers\ClientController;
use Illuminate\Support\Facades\DB;

class ExploreChannelsController extends ClientController
{
    /**
     * 查询我的探店余量
     */

    public function index()
    {

        $we_id = $this->we_id;

        // 查询我的余量
        $result = DB::table('explore_remaining as er')
            ->leftJoin('explore_channel as ec','er.channel_id','=','ec.channel_id')
            ->where('er.we_id','=',$we_id)
            ->where('er.remaining_times','>', 0)
            ->select('er.channel_id','er.remaining_times','er.in_use_times','ec.channel_name')
            ->get()
            ->toArray();

        return $this->setReturnJson(0,'success',$result);

    }

}
